home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmDBMan
- Caption = "Database Management"
- ClientHeight = 2910
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 5565
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2910
- ScaleWidth = 5565
- Begin VB.TextBox txtCountry
- DataField = "country"
- DataSource = "datCities"
- Height = 285
- Left = 1800
- TabIndex = 5
- Top = 1560
- Width = 3495
- End
- Begin VB.TextBox txtCurrency
- DataSource = "datCities"
- Height = 285
- Left = 1800
- TabIndex = 7
- Top = 2520
- Width = 3495
- End
- Begin VB.TextBox txtPopulation
- DataField = "pop1995"
- DataSource = "datCities"
- Height = 285
- Left = 1800
- TabIndex = 6
- Top = 2040
- Width = 3495
- End
- Begin VB.TextBox txtCity
- DataField = "city"
- DataSource = "datCities"
- Height = 285
- Left = 1800
- TabIndex = 4
- Top = 1080
- Width = 3495
- End
- Begin VB.Data datCities
- Caption = " Large World Cities"
- Connect = "Access"
- DatabaseName = "Megacty2.mdb"
- DefaultCursorType= 0 'DefaultCursor
- DefaultType = 2 'UseODBC
- Exclusive = 0 'False
- Height = 300
- Left = 120
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "Cities"
- Top = 600
- Width = 5295
- End
- Begin VB.CommandButton cmdQuit
- Caption = "Exit"
- Height = 375
- Left = 4200
- TabIndex = 2
- Top = 120
- Width = 1215
- End
- Begin VB.CommandButton cmdShowCurrency
- Caption = "Show Currency"
- Height = 375
- Left = 2280
- TabIndex = 1
- Top = 120
- Width = 1695
- End
- Begin VB.CommandButton cmdOrderByPop
- Caption = "Order by Population"
- Height = 375
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 1935
- End
- Begin VB.Label lblCountry
- Caption = "Country:"
- Height = 255
- Left = 960
- TabIndex = 10
- Top = 1560
- Width = 735
- End
- Begin VB.Label lblCurrency
- Alignment = 1 'Right Justify
- Caption = "Currency:"
- Height = 255
- Left = 840
- TabIndex = 9
- Top = 2520
- Width = 855
- End
- Begin VB.Label lblPopulation
- Alignment = 1 'Right Justify
- Caption = "1995 Population:"
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 2040
- Width = 1455
- End
- Begin VB.Label lblCity
- Alignment = 1 'Right Justify
- Caption = "City:"
- Height = 255
- Left = 1320
- TabIndex = 3
- Top = 1080
- Width = 375
- End
- Attribute VB_Name = "frmDBMan"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdOrderByPop_Click()
- Dim strSQL As String
- txtCurrency.DataField = ""
- txtCurrency.Text = ""
- strSQL = "SELECT * FROM Cities ORDER BY pop1995 ASC"
- datCities.RecordSource = strSQL
- datCities.Refresh
- End Sub
- Private Sub cmdQuit_Click()
- End
- End Sub
- Private Sub cmdShowCurrency_Click()
- Dim strSQL As String
- strSQL = "SELECT city, Cities.country, Cities.pop1995, currency " & _
- "FROM Cities INNER JOIN Countries " & _
- "ON Cities.country=Countries.country " & _
- "ORDER BY city ASC"
- datCities.RecordSource = strSQL
- datCities.Refresh
- txtCurrency.DataField = "currency"
- End Sub
- Private Sub Form_Load()
- 'Look for the data base in the same folder as the program
- datCities.DatabaseName = App.Path & "\MEGACTY2.MDB"
- End Sub
-